package asteroids.expression;
import asteroids.model.programs.*;

public class Multiplication extends NumericExpression {
	

	public Multiplication(Expression exp1,Expression exp2){
		super(exp1,exp2);
	}

	@Override
	public double getValue(Program program) {
		this.updateArguments(program);
		if((Double.isNaN(((NumericExpression)this.arg1).getValue(program)))||(Double.isNaN(((NumericExpression)this.arg2).getValue(program)))){
		return 0.001;
		}else{return ( ((NumericExpression)this.arg1).getValue(program) * ((NumericExpression)this.arg2).getValue(program));
	}
		}
}
